package com.sun.baizhi.springboot;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component //默认持久化 非独占 不是自动删除的队列
@RabbitListener(queuesToDeclare = @Queue(value = "hello",durable = "false",autoDelete = "true"))
public class Consumer {

    @RabbitHandler
    public void helloConsumer(String message){
        System.out.println(message);
    }
}
